`timescale 10ns/1ps

module SingleCycleProcessor_tb();
	
	reg iClk,iPCreset,iInstWrENB;
	reg [7:0] iInstAddr,iInstInput;
	
	wire [7:0] oDataMemOut;
	
	SingleCycleProcessor U1(
	iClk, iPCreset,
	iInstWrENB,	// instMemory의 값을 갱신하기 위한 입력 (iWriteENB)
	iInstAddr,	// iInstWrite == 1의 상태에서 접근되는 instruction 주소 [7:0]
	iInstInput, // iInstWrite == 1의 상태에서 입력되는 instruction [7:0]
	oDataMemOut	// output of data memory module
	);
	
	parameter PERIOD = 20;
	
  initial begin
    iClk=1;  
    iPCreset=0; 
    iInstWrENB=1;
    iInstAddr=0;
    iInstInput=0;
    forever #8 iClk=~iClk; 
    end 
    
    initial begin    
    #PERIOD;
    iInstAddr = 8'b00000000; iInstInput = 8'b00110100; #PERIOD;
    iInstAddr = 8'b00000001; iInstInput = 8'b00000001; #PERIOD;
    iInstAddr = 8'b00000010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00000011; iInstInput = 8'b00000000; #PERIOD;//1
    
    iInstAddr = 8'b00000100; iInstInput = 8'b00110100; #PERIOD;
    iInstAddr = 8'b00000101; iInstInput = 8'b00000010; #PERIOD;
    iInstAddr = 8'b00000110; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00000111; iInstInput = 8'b00000000; #PERIOD;//2 
   
    iInstAddr = 8'b00001000; iInstInput = 8'b00110100; #PERIOD;
    iInstAddr = 8'b00001001; iInstInput = 8'b00000011; #PERIOD;
    iInstAddr = 8'b00001010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00001011; iInstInput = 8'b00000001; #PERIOD;//3
    
    iInstAddr = 8'b00001100; iInstInput = 8'b00110100; #PERIOD;
    iInstAddr = 8'b00001101; iInstInput = 8'b00000100; #PERIOD;
    iInstAddr = 8'b00001110; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00001111; iInstInput = 8'b00010000; #PERIOD;//4
    
    iInstAddr = 8'b00010000; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00010001; iInstInput = 8'b01000011; #PERIOD;
    iInstAddr = 8'b00010010; iInstInput = 8'b00010000; #PERIOD;
    iInstAddr = 8'b00010011; iInstInput = 8'b00100000; #PERIOD;//5
    
    iInstAddr = 8'b00010100; iInstInput = 8'b10101100; #PERIOD;
    iInstAddr = 8'b00010101; iInstInput = 8'b01000010; #PERIOD;
    iInstAddr = 8'b00010110; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00010111; iInstInput = 8'b00000000; #PERIOD;//6
    
    iInstAddr = 8'b00011000; iInstInput = 8'b00010000; #PERIOD;
    iInstAddr = 8'b00011001; iInstInput = 8'b01000100; #PERIOD;
    iInstAddr = 8'b00011010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00011011; iInstInput = 8'b00000001; #PERIOD;//7
    
    iInstAddr = 8'b00011100; iInstInput = 8'b00001000; #PERIOD;
    iInstAddr = 8'b00011101; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00011110; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00011111; iInstInput = 8'b00000100; #PERIOD;//8
    
    iInstAddr = 8'b00100000; iInstInput = 8'b00110100; #PERIOD;
    iInstAddr = 8'b00100001; iInstInput = 8'b00000010; #PERIOD;
    iInstAddr = 8'b00100010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00100011; iInstInput = 8'b00000000; #PERIOD;//9
    
    iInstAddr = 8'b00100100; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00100101; iInstInput = 8'b01000011; #PERIOD;
    iInstAddr = 8'b00100110; iInstInput = 8'b00010000; #PERIOD;
    iInstAddr = 8'b00100111; iInstInput = 8'b00100000; #PERIOD;//10
    
    iInstAddr = 8'b00101000; iInstInput = 8'b10001100; #PERIOD;
    iInstAddr = 8'b00101001; iInstInput = 8'b01000101; #PERIOD;
    iInstAddr = 8'b00101010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00101011; iInstInput = 8'b00000000; #PERIOD;//11
    
    iInstAddr = 8'b00101100; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00101101; iInstInput = 8'b00100101; #PERIOD;
    iInstAddr = 8'b00101110; iInstInput = 8'b00001000; #PERIOD;
    iInstAddr = 8'b00101111; iInstInput = 8'b00100000; #PERIOD;//12
    
    iInstAddr = 8'b00110000; iInstInput = 8'b00010000; #PERIOD;
    iInstAddr = 8'b00110001; iInstInput = 8'b01000100; #PERIOD;
    iInstAddr = 8'b00110010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00110011; iInstInput = 8'b00000001; #PERIOD;//13
    
    iInstAddr = 8'b00111000; iInstInput = 8'b00001000; #PERIOD;
    iInstAddr = 8'b00111001; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00111010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b00111011; iInstInput = 8'b00001001; #PERIOD;//14
    
    iInstAddr = 8'b01000000; iInstInput = 8'b10101100; #PERIOD;
    iInstAddr = 8'b01000001; iInstInput = 8'b01000001; #PERIOD;
    iInstAddr = 8'b01000010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b01000011; iInstInput = 8'b00000001; #PERIOD;//15
    
    iInstAddr = 8'b01000100; iInstInput = 8'b00001000; #PERIOD;
    iInstAddr = 8'b01000101; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b01000110; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b01000111; iInstInput = 8'b00010000; #PERIOD;//16
    
    iInstAddr = 8'b01001000; iInstInput = 8'b00001000; #PERIOD;
    iInstAddr = 8'b01001001; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b01001010; iInstInput = 8'b00000000; #PERIOD;
    iInstAddr = 8'b01001011; iInstInput = 8'b00001111; #PERIOD;//17
    
    iInstWrENB=0; iPCreset=1; #PERIOD;
    
    iPCreset=0; #PERIOD;
    
    #PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;#PERIOD;

    $stop;
    
  end
	
	
	endmodule